package com.fr.report.write;

import com.fr.base.core.FRCoreContext;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.report.Report;
import com.fr.report.TableDataSource;
import java.util.Map;

public class ClassSubmiter extends AbstractSubmiter
{
  private String className;

  public ClassSubmiter()
  {
  }

  public ClassSubmiter(String paramString)
  {
    setClassName(paramString);
  }

  public String getClassName()
  {
    return this.className;
  }

  public void setClassName(String paramString)
  {
    this.className = paramString;
  }

  public void execute(Report paramReport, TableDataSource paramTableDataSource, Map paramMap)
    throws Exception
  {
    try
    {
      super.execute(paramReport, paramTableDataSource, paramMap);
    }
    catch (MismatchException localMismatchException)
    {
      return;
    }
    Submiter localSubmiter = (Submiter)FRCoreContext.classForName(getClassName()).newInstance();
    localSubmiter.execute(paramReport, paramTableDataSource, paramMap);
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    super.readXML(paramXMLableReader);
    if ((paramXMLableReader.isChildNode()) && (paramXMLableReader.getTagName().equals("Class")))
    {
      String str;
      if ((str = paramXMLableReader.getAttr("className")) != null)
        setClassName(str);
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("Class").attr("className", getClassName()).end();
    super.writeXML(paramXMLPrintWriter);
  }
}